﻿@namespace Masa.Blazor.Presets

<MSnackbar Value="Value"
           ValueChanged="ValueChanged"
           Color="@ComputedColor"
           Class="@Class"
           ContentClass="@ContentClass"
           Dark="@Dark"
           Elevation="@Elevation"
           Light="@Light"
           MultiLine="@MultiLine"
           Outlined="@Outlined"
           Rounded="@Rounded"
           Shaped="@Shaped"
           Style="@Style"
           Text="@Text"
           Tile="@Tile"
           Timeout="@ComputedTimeout"
           Vertical="@Vertical"
           Top="Top"
           Right="Right"
           Bottom="Bottom"
           Left="Left"
           OnClosed="@HandleOnClosed">
    <ChildContent>
        <MAlert Title="@Title" Type="@Type">@Content</MAlert>
    </ChildContent>
    <ActionContent>
        @if (OnAction.HasDelegate)
        {
            <MButton Class="text-capitalize"
                     Color="@(ActionColor ?? "primary")"
                     Loading="@_actionLoading"
                     Text
                     OnClick="HandleOnAction">
                @ActionText
            </MButton>
        }

        @if (ComputedCloseable)
        {
            <MButton Icon OnClick="HandleOnClose">
                <MIcon>mdi-close</MIcon>
            </MButton>
        }
    </ActionContent>
</MSnackbar>
